Pysr 0.01
=========

Pysr is a small search relative python script based on a nameless script
that one friend gave to me six months ago.

Notes on using it
-----------------

You must have Python installed to run the script. It is also recommended to
download psyco from http://psyco.sourceforge.net/ to speed up it. It is not
necessary to have it and no features will be missing without it; it just
makes it run faster. You might also want to have the script in your PATH
environment variable to make searching easier.

How to use it
-------------

Type the name of the script in the terminal or the DOS box. Hit Enter. If
everything is okay, you'll see a error and a brief usage screen.

Quick usage: Type any options, then the pattern that you want to search for
and after that names of all the files you want to search. For example:

pysr.py MARIO super_mario_world.smc

That command will search super_mario_world.smc for the string MARIO.

Searching
---------
The default search is a text search, which is likely what you want if you're
hacking an ocidental game. Currently, it only lets you search for letters.
It will allow mixed-case searches, but it assumes lowercase letters come
immediately after uppercase letters (e.g., if the value of 'Z' is 41,
then the value of 'a' is 42). Anything that isn't a letter is ignored. No,
you can't search for numbers and text like this for now, but if you really
need to search for a number, you can use a hex string or convert each letter
to a number (1=A, 2=B, ...) You can skip letters, too: dots are counted as a
skipped character. For instance, if you search for ab.d, it will match abcd,
as well as abzd, abad, or anything else that can be between the 'b' and the
'd'. You must put quotes around the search string if you use spaces in the
search string; otherwise they'll be mistaken filenames, which will probably
not be found and be ignored.

If you want to search for a hex string, use the '-x' or '--hex' option.
You must put quotes around the hex string, like this:

pysr.py -x "01 04 07" super_mario_world.smc

You must have spaces around each hex byte, too. You can't use "010407". Here,
too, you can skip bytes. This is done by typing either one or two asterisks:

pysr.py -x "01 * 7 ** 10" super_mario_world.smc

Note that it'll work if you type one digit instead of two for a hex byte. 
That's why you can type either one or two asterisks. You can't use more than
two digits, though, because 100 hex needs more than one byte.

Searching Multiple Files
------------------------
You can use the three glob wildcards, e.g.,  * expands to anything, and ?
expands to any character (only one for each ?). Parts in brackets will
be a sequence, e.g., [0-9] means "match only 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9".

Options
-------
-h, --help
A very small usage help.

-x, --hex
Search for a hex string instead of a text string.

